import http from "../utils/http"

let apiApp = {}

//配置相关
apiApp.appConfigFindByType = type => http.get(`/api/app/config/findByType/${type}`, null);
apiApp.appConfigEdit = params => http.post("/api/app/config/edit", params);

//轮播图
apiApp.appLunbotuFindAllByPage = params => http.get("/api/app/lunbotu/findAllByPage", params)
apiApp.appLunbotuEdit = params => http.post("/api/app/lunbotu/edit", params);
apiApp.appLunbotuAdd = params => http.post("/api/app/lunbotu/add", params);
apiApp.appLunbotuDelByIds = id => http.delete("/api/app/lunbotu/delByIds/" + id, null);

//通知
apiApp.appTongzhiFindAllByPage = params => http.get("/api/app/tongzhi/findAllByPage", params)
apiApp.appTongzhiEdit = params => http.post("/api/app/tongzhi/edit", params);
apiApp.appTongzhiAdd = params => http.post("/api/app/tongzhi/add", params);
apiApp.appTongzhiDelByIds = id => http.delete("/api/app/tongzhi/delByIds/" + id, null);

//常见问题
apiApp.appQaFindAllByPage = params => http.get("/api/app/qa/findAllByPage", params)
apiApp.appQaEdit = params => http.post("/api/app/qa/edit", params);
apiApp.appQaAdd = params => http.post("/api/app/qa/add", params);
apiApp.appQaDelByIds = id => http.delete("/api/app/qa/delByIds/" + id, null);

//意见反馈
apiApp.appFankuiFindAllByPage = params => http.get("/api/app/fankui/findAllByPage", params)
apiApp.appFankuiSetState = params => http.post("/api/app/fankui/setState", params)

//字典
apiApp.appDictFindAllByPage = params => http.get("/api/app/dict/findAllByPage", params)
apiApp.appDictFindAllByList = params => http.get("/api/app/dict/findAllByList", params)
apiApp.appDictEdit = params => http.post("/api/app/dict/edit", params);
apiApp.appDictAdd = params => http.post("/api/app/dict/add", params);
apiApp.appDictDelByIds = id => http.delete("/api/app/dict/delByIds/" + id, null);
apiApp.appDictFindByType = type => http.get("/api/app/dict/findByType/" + type, null);

//字典-数据
apiApp.appDictDataFindAllByPage = params => http.get("/api/app/dict/data/findAllByPage", params)
apiApp.appDictDataFindAllByList = params => http.get("/api/app/dict/data/findAllByList", params)
apiApp.appDictDataEdit = params => http.post("/api/app/dict/data/edit", params);
apiApp.appDictDataAdd = params => http.post("/api/app/dict/data/add", params);
apiApp.appDictDataDelByIds = id => http.delete("/api/app/dict/data/delByIds/" + id, null);

//自动生成工具
apiApp.appGenTableFindAllByPage = params => http.get("/api/app/gen/table/findAllByPage", params)
apiApp.appGenTableFindAllByList = params => http.get("/api/app/gen/table/findAllByList", params)
apiApp.appGenTableDbFindAllByPage = params => http.get("/api/app/gen/table/db/findAllByPage", params)
apiApp.appGenTableColumnByTableId = tableId => http.get(`/api/app/gen/table/column/${tableId}`,null)
apiApp.appGenTableImportTable = params => http.post(`/api/app/gen/table/importTable`,params)
apiApp.appGenTableEdit = params => http.post("/api/app/gen/table/edit", params);
apiApp.appGenTableAdd = params => http.post("/api/app/gen/table/add", params);
apiApp.appGenTableDelByIds = id => http.delete("/api/app/gen/table/delByIds/" + id, null);
apiApp.appGenTablePreviewByTableId = tableId => http.get(`/api/app/gen/table/preview/${tableId}`,null)
apiApp.appGenTableDownloadByTableId = id => http.download(`/api/app/gen/table/download/${id}`,null)
apiApp.appGenTableFindById = tableId => http.get(`/api/app/gen/table/findById/${tableId}`)
apiApp.appGenTableGenCodeById = id => http.post("/api/app/gen/table/genCodeById/" + id, null);
apiApp.appGenTableTongbuById = id => http.get(`/api/app/gen/table/tongbuById/${id}`, null);

//资源
apiApp.appResourceFindAllByPage = params => http.get("/api/app/resource/findAllByPage", params)
apiApp.appResourceFindAllByList = params => http.get("/api/app/resource/findAllByList", params)
apiApp.appResourceEdit = params => http.post("/api/app/resource/edit", params);
apiApp.appResourceAdd = params => http.post("/api/app/resource/add", params);
apiApp.appResourceDelByIds = id => http.delete("/api/app/resource/delByIds/" + id, null);

//用户相关
apiApp.appUserFindAllByPage = params => http.get("/api/app/user/findAllByPage", params)

export default apiApp